{{extend './_layouts/home.html'}}
{{block 'head'}}
<style>
  .info{
    display: flex;
    flex-direction: row;
  }
  .info h3{
    margin-right: 20px;
  }
  .avatar{
    width: 50px
  }
  .avatar img{
    width: 100%;
  }
</style>
{{/block}}
{{block 'body'}}
<section class="container">
  {{include './_partials/viewUser-nav.html'}}
  {{ if user.status === 2 }}
  <h3>此用户已被封号</h3>
  {{ else }}
  <div class="col-md-5">
    <h2>用户信息</h2>
    <div class="avatar">
      <img src="{{user.avatar}}" alt="">
    </div>
    <div class="email info">
      <h3>邮箱:</h3>
      <h4>{{user.email}}</h4>
    </div>
    <div class="nickname info">
      <h3>昵称:</h3>
      <h4>{{user.nickname}}</h4>
    </div>
    <div class="liked info">
      <h3>关注的用户数:</h3>
      <h4>{{user.focus.length}}</h4>
    </div>
    <div class="comments info">
      <h3>发表的文章数:</h3>
      <h4>{{user.comments.length}}</h4>
    </div>
    <div class="liked info">
      <h3>喜欢的文章数:</h3>
      <h4>{{user.liked.length}}</h4>
    </div>
    <div class="gender info">
      <h3>性别：</h3>
      {{ if user.gender === 0}}
      <h4>男</h4>
      {{ /if }}
      {{ if user.gender === 1}}
      <h4>女</h4>
      {{ /if }}
      {{ if user.gender === -1}}
      <h4>保密</h4>
      {{ /if }}
    </div>
    <div class="birthday info">
      <h3>生日:</h3>
      {{ if user.birthday !=null}}
      <h4>{{user.birthday}}</h4>
      {{ else }}
      <h4>保密</h4>
      {{ /if }}
    </div>
    <div class="fans info">
      <h3>粉丝:</h3>
      <h4>{{user.fans.length}}</h4>
    </div>
    <div class="focus info">
      <h3>关注:</h3>
      <h4>{{user.focus.length}}</h4>
    </div>
    <div class="status info">
      <h3>帐号状态:</h3>
      {{ if user.status === 0}}
      <h4>正常</h4>
      {{ /if }}
      {{ if user.status === 1}}
      <h4>不可评论</h4>
      {{ /if }}
    </div>
  </div>
  {{ /if }}
</section>
{{/block}}
